{layout name="layout" /}
<form id="form" action="{:url('plus_exam/question/add')}">
<input type="hidden" name="type" value="{$type}">
<table class="formtable">
<tr>
<th>题库类型:</th>
<td>
    <select class="select" name="category_id" datatype="*">
        <option value=""></option>
        {volist name="category_list" id="rs"}
            <option value="{$rs.id}">{$rs.name}</option>
        {/volist}
    </select>
</td>
</tr>
<tr>
<th>题目内容:</th>
<td>
    <textarea datatype="*" class="textarea w400 h80" name="content"></textarea>
</td>
</tr>
{if condition="$type == 1"}
<tr>
    <th>题目选项:<!--单选--></th>
    <td>
        <table class="w500">
            <thead>
            </thead>
            <tbody>
            {volist name="add_option_list" id="rs"}
            <tr>
                <td class="fn-r">
                    <input type="radio" value="{$key}" name="answer" />
                    {$key}. <input  class="input w400" type="text"  name="option_list[{$key}]" value="" />
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
    </td>
</tr>
{elseif condition="$type == 2"/}
<tr>
    <th>题目选项:<!--多选--></th>
    <td>
        <table class="w500">
            <thead>
            </thead>
            <tbody>
            {volist name="add_option_list" id="rs"}
                <tr>
                    <td class="fn-r">
                        <input  type="checkbox" value="{$key}" name="answer[{$key}]">
                        {$key}. <input  class="input w400" type="text"  name="option_list[{$key}]" value="" />
                    </td>
                </tr>
            {/volist}
            </tbody>
        </table>
    </td>
</tr>
{elseif condition="$type == 3"}
<tr>
    <th>题目选项:<!--判断--></th>
    <td>
        <table class="w500">
            <tbody>
            {volist name="add_option_list" id="rs"}
                <tr>
                    <td class="fn-tal">
                        <input  type="radio" value="{$key}" name="answer" /> {$rs}
                    </td>
                </tr>
            {/volist}
            </tbody>
        </table>
    </td>
</tr>
{/if}
<tr>
    <th></th>
    <td>
        <input type="submit" value="{$Think.lang.lang_ui_save}" class="button button-blue submit" />
        <input type="reset" value="{$Think.lang.lang_ui_reset}" class="button button-blank"/>
    </td>
</tr>
</table>
</div>
<script type="text/javascript">
Do('base','layer','form',function(){
$('#form').isForm();
});
</script>